package com.xiaobingby.test;

import org.apache.commons.codec.Charsets;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;

/**
 * @author 李磊
 * @date 2021/7/15 16:01
 */
public class FileProcessor extends BaseProcessor {
    @Override
    public void process(ParamDTO paramDTO) {
        try {
            FileUtils.write(new File("D:\\tmp\\test.xml"),paramDTO.getDocument().asXML(), Charsets.UTF_8);
            paramDTO.setSuccess(true);
            this.getNextProcessor().process(paramDTO);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
